package top.kaoshanji.r1ch04b;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import top.kaoshanji.r1ch04b.helloworld.AutoConfiguration;

/**
 * 代码清单test-r1ch04b-86页c：错误语言的测试
 * @author kaoshanji
 * ^_^
 * create time 2025/5/28 18:45
 */
@SpringJUnitConfig(AutoConfiguration.class)
@TestPropertySource(properties = {
        "spring.speaker.enable=true",
        "spring.speaker.language=Japanese"
})
public class WrongAutoConfigurationTest {

    @Autowired
    private ApplicationContext applicationContext;

    @Test
    public void testHasNoSpeaker() {
        Assertions.assertFalse(applicationContext.containsBean("speaker"));
    }

}
